/**
 *
 */
package view;

import java.awt.BorderLayout;
import java.awt.HeadlessException;

import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.ListSelectionModel;

import model.Model;

/**
 * TODO COMMENT ME!
 * 
 * @author Marco
 */
public class Mainframe extends JFrame {
    private static final long serialVersionUID = 1960556816253235295L;
    private Model             model;
    private JList             seriesList;

    /**
     * Creates a new instance of this class.
     * 
     * @param aFrameTitle
     * @throws HeadlessException
     */
    public Mainframe(Model aModel, String aFrameTitle) throws HeadlessException {
        super(aFrameTitle);
        model = aModel;
        initComponents();

    }

    private void initComponents() {
        setLayout(new BorderLayout());

        seriesList = new JList(new SeriesListModel(
                model.getAvailableEpisodeTitleFolders()));
        seriesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        add(seriesList, BorderLayout.NORTH);

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(400, 500, 800, 500);
        setVisible(true);
    }
}
